/**
 * 
 */
package info.niwota.web.apache;

import info.niwota.web.Debug;
import info.niwota.web.ServerApplication;
import x.org.apache.http.HttpRequest;
import x.org.apache.http.HttpResponse;
import x.org.apache.http.protocol.HttpContext;
import android.content.Context;
import android.util.Log;

/**
 * @author qiangli
 * 
 */
public class DefaultHandler extends BaseHandler {
	private static final String TAG = "DefaultHandler";
	

	public DefaultHandler(Context ctx) {
		super(ctx);
	}

	@Override
	public boolean handle(String p, HttpRequest req, HttpResponse res, HttpContext context) throws Exception {
		try {
			long startup = ServerApplication.startupTime;
			if (Debug.DEBUG) {
				Log.d(TAG, "path: " + p +" startupTime: " + startup);
			}
			sendNotFound(req, res,  p);

		} catch (Exception e) {
			e.printStackTrace();
			sendError(req, res, e);
		}
		return true;
	}

}
